package com.tuocent.dagv2.controller;

import com.tuocent.dagv2.common.AjaxResult;
import com.tuocent.dagv2.service.IExamineLogService;
import com.tuocent.dagv2.service.ILoginLogsService;
import com.tuocent.dagv2.service.IOperateLogsService;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Controller
@RequestMapping("logs")
public class LogController {
    @Autowired
    private ILoginLogsService loginLogsService;
    @Autowired
    private IOperateLogsService operateLogsService;


    @GetMapping("loginLogInfo")
    public String loginLogInfo(Model model) {
        return loginLogsService.loginLogInfo(model);
    }

    @PostMapping("getLoginLogData")
    @ResponseBody
    public AjaxResult getLoginLogData(HttpSession session, @RequestBody Map<String, Object> params) {
        return loginLogsService.getLoginLogData(session, params);
    }


    @GetMapping("operateLogInfo")
    public String operateLogInfo(Model model) {
        return operateLogsService.operateLogInfo(model);
    }

    @PostMapping("getOperateLogData")
    @ResponseBody
    public AjaxResult getOperateLogData(HttpSession session, @RequestBody Map<String, Object> params) {
        return operateLogsService.getOperateLogData(session, params);
    }


}
